package com.example.lenovo.designproxy_lxy;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.lenovo.designproxy_lxy.factory.SubjectStaticFactory;
import com.orhanobut.logger.Logger;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button mStaticProxy;
    private String LogStr = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Logger.init(LogStr);
        setContentView(R.layout.activity_main);
        initView();
        initListener();
    }

    private void initListener() {
        mStaticProxy.setOnClickListener(this);
    }

    private void initView() {
        mStaticProxy = (Button) findViewById(R.id.btStaticProxy);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.btStaticProxy:
                SubjectStaticFactory.getInstance().dealTask("李阳");
                break;
        }
    }
}
